﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;


namespace SomethingSpacial.Helpers
{
    public static class RIAServicesHelper
    {
        public static void InitializeComboBoxIndex(string comboBoxName, DataForm dataFormCurrent)
        {
            ComboBox comboItems = (ComboBox)dataFormCurrent.FindNameInContent(comboBoxName);
            if (comboItems != null)
            {
                if (comboItems.Items.Count > 0)
                {
                    comboItems.SelectedIndex = 0;
                }
            }
        }

        public static string ComboBoxValue(string comboBoxName, DataForm dataFormCurrent)
        {
            string SelectedValue = "";
            ComboBox comboItems = (ComboBox)dataFormCurrent.FindNameInContent(comboBoxName);
            if (comboItems.SelectedIndex > -1)
            {
                SelectedValue = comboItems.SelectedItem.ToString();
                
            }

            return SelectedValue;
        }

    
    }
}
